package cn.com.w.simple.demo.service;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * 存储用户信息的token
 */
@Getter
@Setter
public class AuthenticationToken extends UsernamePasswordAuthenticationToken {


    /**
     * @param principal   用户名
     * @param credentials 密码
     */
    public AuthenticationToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public AuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
    }

}

